package com.hulk.ratel.service.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author cmt
 *
 */

@ToString
public class BaseDTO implements Serializable {
	
	private static final long serialVersionUID = 1L;
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.version}")
	@Length(min=0,max=16,message="{up.basedto.version}")
	private String version="";
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.charset}")
	@Pattern(regexp="^(utf\\-8|UTF\\-8){1}$",message="{up.basedto.charset}")//判断是否等于UTF-8  //TODO
	private String charset="";
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.partnerNo}")
	@Length(min=0,max=16,message="{up.basedto.partnerNo}")
	@Pattern(regexp = "^[a-zA-Z0-9]+$" ,message="{up.basedto.partnerNo}") 
	private String partnerNo="";
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.partnerType}")
	@Length(min=1,max=10,message="{up.basedto.partnerType}")
	@Pattern(regexp = "OUTER|INNER|MERCHANT{1}" ,message="{up.basedto.partnerType}")
	private String partnerType="";
	
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.txnCode}")
	@Length(min=6,max=6,message="{up.basedto.txnCode}")
	@Pattern(regexp = "^[a-zA-Z0-9]+$" ,message="{up.basedto.txnCode}") 
	private String txnCode="";
	@Getter
	@Setter
	@NotBlank(message="{up.basedto.traceId}")
	@Length(min=18,max=32,message="{up.basedto.traceId}")
	//@Pattern(regexp = "^[0-9]+$" ,message="{up.basedto.traceId}")
    private String traceId="";

}
